1. Field of the Invention
The invention relates generally to a method of designating objects visually appearing on a computer monitor during operation of computer application programs, and more particularly, to a method of highlighting objects appearing in a non-linear format.
2. Description of the Related Art
The majority of computer application programs generate data and then output that data to a user as objects (i.e., alpha-numeric characters or graphical objects) appearing visually on a computer monitor. It is often desirable to allow the user to quickly and efficiently manipulate the data generated by the computer program and then output the manipulated data to the user via the computer monitor. For example, in text processor programs, it is desirable to allow the user to designate certain portions of text and then change that designated text by performing stylistic operations such as bolding, underlining, or italicizing. Similarly, in spreadsheet programs, it is desirable to allow the user to designate certain numbers and then change those designated numbers by performing mathematical or statistical operations. Also, in graphic programs, it is desirable to allow the user to designate certain graphical objects and then change those designated objects by performing rotate, invert, move, or similar operations. Generally, an important feature of many computer application programs is the ease with which the user can quickly and efficiently designate data for subsequent manipulation.
The designation process is usually accomplished by moving a cursor to different portions on the visual output of the computer monitor, with the cursor position used to designate the point of data entry. The cursor is a position indicator which is visually displayed on the computer monitor. The cursor can be positioned by a user using many different input devices, including keyboards, "mice", track balls or styluses.
Different visual methods are used by computer application programs to delineate objects (i.e., alpha-numeric characters, graphic objects, or other like items) for manipulation. For example, the application program can change the intensity of the designated objects to highlight either the designated area or the surrounding area. Also, the application program can change the color of the designated objects to differ from the background in surrounding areas. Alternatively, the program can cause the designated objects to "blink" and thereby distinguish those objects from the surrounding area.
A common method used to delineate selected objects is to highlight them using an "invert" operation. Inverting is a graphic operation performed on a set of pixels on the computer monitor. That set may include only one pixel, all of the pixels inside a rectangle, or any possibly disconnected set of areas of the computer monitor. Inverting a pixel "reverses" its color. Thus, black pixels become white, and white pixels become black. Every color has its own "reverse" color as well. Inverting has a number of properties which make it well suited to object highlighting. First, it produces high-contrast results, making it easy to see what is highlighted. Second, it is reversible, since inverting an area of the computer monitor twice results in the original set of colors. Finally, it is applied to objects that have already been drawn, without requiring that the highlighted object be redrawn when it is selected or de-selected. The combination of the later two properties are important because redrawing the objects is often unacceptably slow.
There exists today two standard invert-based techniques used by application programs to highlight objects on the computer monitor. These techniques are described in detail below.
For most application programs, a simple technique can be used to highlight all of the selected objects using inverting. The simple technique operates as follows: For each object, calculate an area which encloses the object and invert that area. For n objects, this results in n highlighted areas on the computer monitor, without having to redraw the selected objects. Most existing text processors and spreadsheets use this technique to highlight selected words. For each word to be highlighted, the text processor first determines the "bounding box" of the word. The bounding box is the possibly rotated rectangle that encloses the word on the screen. This bounding box is then inverted and the next word is processed.
The simple technique, however, will fail if it is possible for the area enclosing one object to overlap with the area enclosing another object. In this case some pixels may be inverted more than once, resulting in inaccurate highlighting. This is often referred to as the "double invert" problem. Specifically, if two objects have overlapping areas, the pixels which are common to both objects will be inverted twice. This results in an area which appears to be unselected, and if the objects overlap significantly, neither object will appear selected at all. Conventional text processors as described above have a number of qualities which prevent this problem. Specifically, the conventional text processors have extensive knowledge and control over the relative position of words and characters in the document, and they require that the text be placed in linear, horizontal positions with no rotated or overlapping text. The net result of these limitations is that no bounding boxes overlap, thereby allowing the conventional text processors to avoid "double inverts."
More complicated object processing application programs allow arbitrarily positioned and rotated objects and overlapping bounding boxes. Highlighting in these types of applications, therefore, cannot be accurately performed using the simple technique described above. Instead, these application programs traditionally use a second technique that requires the use of a powerful geometric object called a "region." Like rectangles, a region defines a set of pixels on the computer monitor. Regions, however, can define any combination of pixels, including disjoint and non-rectangular areas. Specifically, a single region can be created that contains exactly the same pixels as the combination of any number of rectangles. Such a region is created by using a "union" operation. The union of two regions is a new region which contains all of the pixels in either region, including pixels which are in both regions. Thus, if an application program can create a series of regions which enclose each object to be highlighted, then a single region can be formed that contains every pixel that should be inverted on the computer monitor.
By using region operations, the second technique can accurately highlight any set of objects on the screen. The second technique operates as follows. Start with an empty region X. For each object to be highlighted, create a temporary region that encloses the object. This region, for example, might just be the region which contains the same pixels as the object's bounding box. Next, union this temporary region with region X, and replace X with the result of the union. Repeat these steps for each object to be highlighted. Finally, invert region X once and all of the objects get highlighted at once, with no possibility of double inverts.
While this second technique has been used by application programs to produce accurate highlighting, it suffers two major deficiencies, both relating to the fact that it depends on region operations. First, the second technique might fail in practice because region operations require a great deal of memory resources of the computer system. This can lead to low-memory situations where a region union or region invert could in fact fail completely, resulting in inaccurate or non-existent highlighting. In the worst case, this could lead to a system crash. Second, the second technique can be extremely slow in practice because region operations themselves are slow. Further, as a region gets more complex, the time required to perform an operation on it increases greatly. Hence, when the objects to be highlighted are complex and/or numerous, the performance of the second technique can become unusable, even on the fastest of computers.
Thus, existing methods of highlighting text cannot highlight overlapping or non-linear text in a fast, reliable and efficient manner without double inverts. Use of bounding rectangles allows a fast and efficient highlight operation, but often results in double inverts. Similarly, use of a single bounding region to highlight text prevents double inverts, but cannot perform the operation in a fast and efficient manner. A need exists for a fast, reliable and efficient method to highlight overlapping or rotated text without incurring any double inverts.